---
title:  Exporting and Importing Cluster Configurations
---

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

The cluster configuration service exports and imports configurations created using `gfsh` for an entire <%=vars.product_name_long%> cluster.

The cluster configuration service saves the cluster configuration as you create regions, disk-stores and other objects using `gfsh` commands. You can export this configuration as well as any jar files that contain application files to a zip file and then import this configuration to create a new cluster.

## Exporting a Cluster Configuration

Issue the `gfsh` `export cluster-configuration` command to save the configuration data for your
cluster in a zip file. This zip file contains subdirectories for cluster-level configurations and a
directory for each group specified in the cluster. The contents of these directories are described
in [Cluster Configuration Files and Troubleshooting](gfsh_config_troubleshooting.html#concept_ylt_2cb_y4).

To export a cluster configuration, run the `gfsh` `export cluster-configuration` command while connected to a <%=vars.product_name%> cluster. For example:

``` pre
export cluster-configuration --zip-file-name=/home/username/configs/myClusterConfig.zip
```

See [export cluster-configuration](../../tools_modules/gfsh/command-pages/export.html#topic_mdv_jgz_ck).

**Note:**
`gfsh` only saves cluster configuration values for configurations specified using `gfsh`. Configurations created by the management API are not saved with the cluster configurations.

## Importing a Cluster Configuration

Use the `gfsh` `import cluster-configuration` command to configure a new cluster based on a configuration exported from another system.
You can import a cluster configuration only into a new cluster, that is, when:

- There are no running cache servers

or

- The only running cache servers meet all of the following criteria:
  - Have been recently started
  - Have no regions defined in them
  - Have been given no other configuration changes since they started

After you have imported the configuration, any servers you start receive this cluster configuration.

To import a cluster configuration, start one or more locators and then run the `gfsh` `import cluster-configuration` command. For example:

``` pre
import cluster-configuration --zip-file-name=/home/username/configs/myClusterConfig.zip
```

See [import cluster-configuration](../../tools_modules/gfsh/command-pages/import.html#topic_vnv_grz_ck).

